package com.lichuang.dedao.user.service.impl;

import com.lichuang.dedao.user.entity.Coupon;
import com.lichuang.dedao.user.mapper.CouponMapper;
import com.lichuang.dedao.user.service.ICouponService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * <p>
 * 卡券 服务实现类
 * </p>
 *
 * @author hanghang
 * @since 2019-07-15
 */
@Service
public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon> implements ICouponService {

    @Override
    public Integer addCoupon(Coupon coupon) {
        coupon.setCreateTime(LocalDateTime.now());
        Integer count = baseMapper.insert(coupon);
        return count;
    }
}
